package com.wyj.server;

import java.util.List;

/**
 * TODO: 引擎。一个Container只有一个engine
 *
 * @author wuyijie
 * @date 2021/12/13 22:01
 */
public class Engine extends BaseLiflecycleBean{
    private String name;
    private String defaultHost;

    private List<Host> hostList;

    public Engine() {
    }

    public Engine(String name, String defaultHost) {
        this.name = name;
        this.defaultHost = defaultHost;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDefaultHost() {
        return defaultHost;
    }

    public void setDefaultHost(String defaultHost) {
        this.defaultHost = defaultHost;
    }

    public List<Host> getHostList() {
        return hostList;
    }

    public void setHostList(List<Host> hostList) {
        this.hostList = hostList;
    }

    @Override
    public String toString() {
        return "Engine{" +
                "name='" + name + '\'' +
                ", defaultHost='" + defaultHost + '\'' +
                ", hostList=" + hostList +
                '}';
    }

    @Override
    public void init() {
        for (Host host : this.hostList) {
            host.init();
        }
    }

    @Override
    public void start() {

    }
}
